package com.example.demo.repository;

import com.example.demo.entity.User;
import com.example.demo.entity.UserType;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Optional;

@Repository
public interface UserRepository extends JpaRepository<User, Long> {
    Optional<User> findByUsername(String username);
    Optional<User> findByStudentId(String studentId);
    Optional<User> findByTeacherId(String teacherId);
    List<User> findByUserType(UserType userType);
    List<User> findByCollege(String college);
    boolean existsByUsername(String username);
    boolean existsByStudentId(String studentId);
    boolean existsByTeacherId(String teacherId);
} 